﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UploadPhotoTool.Upload
{
    /// <summary>
    /// 文件上传状态
    /// </summary>
    enum E_FileUploadStatus
    {
        未开始,
        上传中,
        已完成,
        上传错误,
        已取消
    }

    class UploadFile
    {
        #region 上传的文件
        private FileInfo file;

        /// <summary>
        /// 上传的文件
        /// </summary>
        public FileInfo File
        {
            get { return file; }
            set { file = value; }
        }
        #endregion

        #region 已上传大小
        private long uploadedSize = 0;

        /// <summary>
        /// 已上传大小
        /// </summary>
        public long UploadedSize
        {
            get { return uploadedSize; }
            set { uploadedSize = value; }
        }
        #endregion

        #region 上传进度
        private double uploadProgress;

        /// <summary>
        /// 上传进度
        /// </summary>
        public double UploadProgress
        {
            get { return uploadProgress; }
            set { uploadProgress = value; }
        }
        #endregion

        #region 文件上传状态
        private E_FileUploadStatus uploadStatus = E_FileUploadStatus.未开始;

        public E_FileUploadStatus UploadStatus
        {
            get { return uploadStatus; }
            set { uploadStatus = value; }
        }
        #endregion

        #region 错误消息
        private string errorMessage;

        public string ErrorMessasge
        {
            get { return errorMessage; }
            set { errorMessage = value; }
        }
        #endregion

        public UploadFile(FileInfo f)
        {
            this.File = f;
        }
    }
}
